package cn.com.thingo.shyintelligent.model.http;


import javax.inject.Inject;

import cn.com.thingo.shyintelligent.model.bean.CommonBean;
import cn.com.thingo.shyintelligent.model.bean.GatewayListBean;
import cn.com.thingo.shyintelligent.model.bean.LoginBean;
import cn.com.thingo.shyintelligent.model.bean.MessageListBean;
import cn.com.thingo.shyintelligent.model.bean.UserBean;
import cn.com.thingo.shyintelligent.model.http.api.ShouCheApis;
import io.reactivex.Flowable;
import okhttp3.MultipartBody;
import okhttp3.RequestBody;

/**
 * Created by Administrator on 2017/10/9.
 */

public class RetrofitHelper implements HttpHelper {

    private ShouCheApis mShouCheApiService;

    @Inject
    public RetrofitHelper(ShouCheApis shouCheApiService) {
        this.mShouCheApiService = shouCheApiService;
    }

    //获取手机验证码
    @Override
    public Flowable<CommonBean> getCode(String telephone) {
        return mShouCheApiService.sendCode(telephone);
    }

    @Override
    public Flowable<CommonBean> register(String code, String password, String telephone) {
        return mShouCheApiService.register(code, password, telephone);
    }

    @Override
    public Flowable<LoginBean> login(String password, String telephone) {
        return mShouCheApiService.login(password, telephone);
    }

    @Override
    public Flowable<GatewayListBean> gatewayList(String token) {
        return mShouCheApiService.gatewayList(token);
    }

    @Override
    public Flowable<CommonBean> addGateway(String username, String password, String number, String title, String token) {
        return mShouCheApiService.addGateway(username, password, number, title, token);
    }

    @Override
    public Flowable<UserBean> getUser(String token) {
        return mShouCheApiService.getUser(token);
    }

    @Override
    public Flowable<CommonBean> modifyHead(RequestBody token, MultipartBody.Part headPic) {
        return mShouCheApiService.modifyHead(token, headPic);
    }

    @Override
    public Flowable<CommonBean> modifyPassword(String password, String telephone, String code) {
        return mShouCheApiService.modifyPassword(password, telephone, code);
    }


    @Override
    public Flowable<CommonBean> addMessage(String token, String title, String content) {
        return mShouCheApiService.addMessage(token, title, content);
    }

    @Override
    public Flowable<MessageListBean> messageList(String token) {
        return mShouCheApiService.messageList(token);
    }

    @Override
    public Flowable<CommonBean> messageCount(String token) {
        return mShouCheApiService.messageCount(token);
    }

    @Override
    public Flowable<CommonBean> readMessage(String token, String messageId) {
        return mShouCheApiService.readMessage(token, messageId);
    }

}
